<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var str="经常看CCTV能强身壮体,要经常看cctv哦";
        var nstr=str.replace(/cctv/ig,'****');
        console.log(nstr)
    </script>
</body>
</html>